/**
 * Created by meiguizhinian on 2018/7/26
 * Copyright © 2018 lixiaolong. All rights reserved.
 */

//单例/全静态/枚举
jssupport.UserDataManager = {
	file : null,
	_path : "USERDATA",
	sharedInstance: function () {
		return this;
	},

	read: function () {
		this.file = cc.sys.localStorage.getItem(this._path);
		if (this.file) {
			this.file = JSON.parse(this.file);
		} else {
			this.file = {};
		}
	},
	write : function () {
		let str = JSON.stringify(this.file);
		cc.sys.localStorage.setItem(this._path, str);
	}
};
